// PrintBinaryTreeByLevel.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "BinaryTree.h"

#define M 9

using namespace CodeMood;

int _tmain(int argc, _TCHAR* argv[])
{
	Node<int> nodes[M];
	for (int i = 0; i < M; ++i) {
		nodes[i].data_ = i;
	}

	// build binary tree
	link(nodes, 1, 2, 3);
	link(nodes, 2, 4, 5);
	link(nodes, 3, -1, 6);
	link(nodes, 5, 7, 8);

	PrintTreeNodeByLevelVector(&nodes[1]);
	cout << endl;

	PrintTreeNodeByLevelDeque(&nodes[1]);
	cout << endl;

	return 0;
}
